import { Navigate } from 'react-router-dom';
import { isAdmin } from '@utils/WeStudyUtil';

export default function AuthAdmin({ children }: any) {
  const admin = isAdmin();
  if (admin) {
    return children;
  } else {
    return <Navigate to="/study"></Navigate>;
  }
}